package com.oocl.euc.core.requestform.model;
import com.oocl.euc.audit.AuditEntity;
import com.oocl.euc.common.constant.ProceduresType;
import com.oocl.euc.core.requestform.bo.ChangeDetail;
import javax.persistence.*;
import java.util.*;
import java.util.stream.Collectors;

@Entity
@Table(name = "PCRS_REQUEST_FORM")
@SequenceGenerator(name = "SEQUENCE_GENERATOR", sequenceName = "REQUEST_FORM_SEQUENCE", allocationSize = 1)
public class RequestForm extends AuditEntity {
    @Column(name = "REF_NO", length = 20)
    private String refNO;
    @Column(name = "REF_NUMBER")
    private Long refNumber;
    @Column(name = "REQUEST_STATUS", length = 60)
    private String requestStatus;
    @Column(name = "REQUEST_PRE_STATUS", length = 60)
    private String requestPreStatus;
    @Column(name = "REQUESTER_STAFF_ID", length = 20)
    private String requesterStaffId;
    @Column(name = "REQUESTER_DOMAIN_ID", length = 20)
    private String requesterDomainId;
    @Column(name = "REQUESTER_DISPLAY_NAME", length = 128)
    private String requesterDisplayName;
    @Column(name = "EMAIL", length = 125)
    private String email;
    @Column(name = "PHONE", length = 20)
    private String phone;
    @Column(name = "TEAM_NAME", length = 20)
    private String teamName;
    @Column(name = "ENDORSER_LIST", length = 255)
    private String endorserList;
    @Column(name = "RELATE_CATEGORY_NAME", length = 50)
    private String relateCategoryName;
    @Column(name = "RELATE_SUBCATEGORY_LIST", length = 4000)
    private String relateSubCategoryList;
    @Column(name = "COPY_TO", length = 1000)
    private String copyTo;
    @Column(name = "NEED_NOTIFY_HKCTR")
    private Integer needNotifyHkctr;
    @Column(name = "TT_NUMBER", length = 510)
    private String ttNumber;
    @Column(name = "TT_LEVEL", length = 125)
    private String ttLevel;
    @Column(name = "CHANGE_TYPE", length = 125)
    private String changeType;
    @Column(name = "CHANGE_CLASSIFICATION", length = 510)
    private String changeClassification;
    @Column(name = "URGENCY", length = 510)
    private String urgency;
    @Column(name = "CHANGE_OBJECTIVE", length = 510)
    private String changeObjective;
    @Column(name = "RELATED_PCRS", length = 100)
    private String relatedPcrs;

    @Column(name = "CATEGORY_ID", length = 20)
    private String categoryId;
    @Column(name = "SUBCATEGORY_ID", length = 20)
    private String subcategoryId;
    @Column(name = "INVOLVED_PLATFORM", length = 125)
    private String involvedPlatform;
    @Column(name = "EXPECTED_DATE")
    private Date expectedDate;
    @Column(name = "EXPECTED_TIME", length = 20)
    private String expectedTime;
    @Column(name = "EMERGENCY_ID", length = 100)
    private String emergencyId;
    @Column(name = "SECADMIN_REF", length = 4000)
    private String secadminRef;
    @Column(name = "ONLINE_SERVICE_IMPACT", length = 4000)
    private String onlineServiceImpact;
    @Column(name = "SERVICE_IMPACT_FROM_DATE")
    private Date onlineServiceImpactFromDate;
    @Column(name = "SERVICE_IMPACT_TO_DATE")
    private Date onlineServiceImpactToDate;
    @Column(name = "APPROVE_ONLINE_SERVICE_IMPACT", length = 10)
    private String approveOnlineServiceImpact;
    @Column(name = "APPROVE_QA_TEST_RESULT", length = 10)
    private String approveQATestResult;
    @Column(name = "APPROVE_PP_RUN_RESULT", length = 10)
    private String approvePPRunResult;
    @Column(name = "NEED_POST_ANNOUNCE")
    private Integer needPostAnnounce;
    @Column(name = "APPLICATION_IMPACT", length = 4000)
    private String applicationImpact;
    @Column(name = "SYSTEM_IMPACT", length = 4000)
    private String systemImpact;

    @Column(name = "HAS_MORE_VERIFIER")
    private String hasMore2ndVerifier;
    @Column(name = "DR_RATING", length = 20)
    private String drRating;
    @Column(name = "DR_SETUP_STATUS")
    private String drSetupStatus;
    @Column(name = "DR_SETUP_DATE")
    private Date drSetupDate;
    @Column(name = "DR_INFO", length = 4000)
    private String drInfo;
    @Column(name = "WORKING_DURIATION", length = 30)
    private String workingDuriation;
    @Column(name = "VERIFICATION_DURIATION", length = 30)
    private String verificationDuriation;
    @Column(name = "SECOND_VERIFIER", length = 30)
    private String secondVerifier;
    @Column(name = "COORDINATOR", length = 255)
    private String coordinator;
    @Column(name = "CONTACT_NO", length = 255)
    private String contactNo;
    @Column(name = "VERIFICATION_DEADLINE")
    private Date verificationDeadling;
    @Column(name = "RECOVERY_DURIATION", length = 30)
    private String recoveryDuriation;
    @Column(name = "TEST_ENV", length = 255)
    private String testEnv;
    @Column(name = "REMARKS", length = 4000)
    private String remarks;
    @Column(name = "CHG_CTL_REF", length = 4000)
    private String chgCtlRef;
    @Column(name = "VERIFICATION_RESULT", length = 255)
    private String verificationResult;
    @Column(name = "VERIFICATION_REASON", length = 4000)
    private String verificationReason;
    @Column(name = "VERIFICATION_IMPACT", length = 4000)
    private String verificationImpact;
    @Column(name = "FIRST_VERIFICATION_REASON", length = 4000)
    private String firstVerificationReason;
    @Column(name = "FIRST_VERIFICATION_IMPACT", length = 4000)
    private String firstVerificationImpact;
    @Column(name = "ENDORSED_AT")
    private Date endorsedAt;
    @Column(name = "ENDORSED_BY", length = 20)
    private String endorsedBy;
    @Column(name = "CIRCULATED_AT")
    private Date circulatedAt;

    @Column(name = "PROGRESS")
    private String progress;
    @Column(name = "INCHARGE_BY")
    private String inchargeBy;

    @Column(name = "DISASTER_RECOVERY")
    private String disasterRecovery;
    @Column(name = "REQUIRE_FALLBACK")
    private String requireFallBack;
    @Column(name = "FIRST_VERIFY_CUTOVER_FALLBACK")
    private String firstVerifyFallBack;
    @Column(name = "SECOND_VERIFY_CUTOVER_FALLBACK")
    private String secondVerifyFallBack;
    @Column(name = "TESTING_RESULT")
    private String testingResult;
    @Column(name = "PP_TRIAL_RUN_RESULT")
    private String ppTrialRunResult;
    @Column(name = "PP_CONFIRMATION_DATE")
    private Date ppConfirmationDate;

    @Column(name = "REASON_OF_FALLBACK_ACTION")
    private String reasonOfFallbackAction;
    @Column(name = "FIRST_VERIFICATION_RESULT", length = 255)
    private String firstVerificationResult;
    @Column(name = "FIRST_VERIFIER")
    private String firstVerifier;
    @Column(name = "FIRST_COORDINATOR")
    private String firstCoordinator;
    @Column(name = "FIRST_CONTACTNO")
    private String firstContactNo;

    @Column(name = "hasMoreFirstVerifier")
    private String hasMoreFirstVerifier;
    @Column(name = "CREATE_FROM")
    private String createFrom;
    @Column(name = "CMS_NO")
    private String cmsNo;

    @Transient
    private Boolean isStartProcessTask;

    @Column(name = "CUTOVER_COUNT")
    private String cutoverCount;

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    @JoinColumn(name = "REQUEST_FORM_ID")
    private List<RequestProcedures> requestprocedures;
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    @JoinColumn(name = "REQUEST_FORM_ID")
    private List<RequestAttachment> requestattachments;
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    @JoinColumn(name = "REQUEST_FORM_ID")
    private List<RequestPostmortem> requestpostmortem;

    @Transient
    private String requestType;
    @Transient
    private String oldExpectedDate;
    @Transient
    private String oldExpectedTime;
    @Transient
    private List<ChangeDetail> recoveryChangeDetails;
    @Transient
    private List<ChangeDetail> procedureChangeDetails;
    @Transient
    private String hasOnlineServiceImpact;
    @Transient
    private String oldHasOnlineServiceImpact;
    @Transient
    private String hasApplicationImpact;
    @Transient
    private String oldHasApplicationImpact;
    @Transient
    private String oldOnlineServiceImpact;
    @Transient
    private Date oldOnlineServiceImpactFromDate;
    @Transient
    private Date oldOnlineServiceImpactToDate;
    @Transient
    private String oldApplicationServiceImpact;
    @Column(name = "APPROVE_IMPACT_BY", length = 20)
    private String approveImpactBy;
    @Transient
    private String oldCategoryName;
    @Transient
    private String oldSubCategoryName;

    @Transient
    private List<String> firstVerificationResultList;
    @Transient
    private Boolean importantFieldIsChanged = false;
    @Transient
    private Boolean workingProcedureChanged = false;

    @Transient
    private String oldPPRunResult;
    @Transient
    private Boolean isPPNeedToPending = false;
    @Transient
    private Boolean isQANeedToPending = false;
    @Transient
    private String oldQATestingResult;
    @Column(name = "APPROVAL_IS_NEEDED", length = 10)
    private String approvalIsNeeded;
    @Column(name = "APPROVAL_CATEGORY_IS_NEEDED", length = 10)
    private String approvalCategoryIsNeeded;
    @Transient
    private Boolean wpTaskStatusIsChanged = false;
    @Transient
    private String changeWorkingStatusBy;
    @Transient
    private String changeImportantFieldsAndQAPPBy;
    @Transient
    private Boolean serviceImpactIsApproved = false;
    @Transient
    private Boolean firVerificationIsChanged = false;
    @Transient
    private Boolean secVerificationIsChanged = false;
    @Transient
    private Boolean qaTestingResultIsChanged = false;
    @Transient
    private Boolean ppRunResultIsChanged = false;
    @Transient
    private Boolean statusIsChangedByHKCTR = false;
    @Transient
    private String changeStatusBy;
    @Transient
    private Boolean chgcntlIsChanged = false;
    @Transient
    private String changeChgcntlBy;
    @Transient
    private Boolean isApprover = false;
    @Transient
    private Boolean isPCRSDone = false;
    @Transient
    private Boolean isAcceptPP = false;
    @Transient
    private Boolean isAcceptQA = false;
    @Transient
    private String acceptBy;

    @Column(name = "SERVICE")
    private String service;
    @Column(name = "LOCATIONS")
    private String locations;
    @Column(name = "ZONES")
    private String zones;

    @Column(name = "RISK_LEVEL")
    private String riskLevel;
    @Column(name = "RISK_ASSESSMENT")
    private String riskAssessment;
    @Column(name = "RA_REVIEW_RESULT")
    private String riskAssessmentReviewResult;
    @Column(name = "RA_REMARK")
    private String riskAssessmentRemark;
    @Column(name = "RA_PROGRESS")
    private String riskAssessmentProgress;
    @Transient
    private Boolean riskAssessmentIsChanged = false;
    @Transient
    private Boolean isNeedRollBackStatus = false;
    @Transient
    private String oldRiskAssessmentReviewResult;
    @Transient
    private String oldRiskAssessmentRemark;
    @Transient
    private String oldRiskAssessmentProgress;
    @Transient
    private String newRiskLevel;
    @Transient
    private String oldRiskLevel;

    @Transient
    private Boolean isNeedChangeObjective = false;
    @Transient
    private String oldChangeObjective;
    @Transient
    private String oldStatus;

    public String getRefNO() {
        return refNO;
    }

    public void setRefNO(String refNO) {
        this.refNO = refNO;
    }

    public String getCutoverCount() {
        return cutoverCount;
    }

    public void setCutoverCount(String cutoverCount) {
        this.cutoverCount = cutoverCount;
    }

    public Long getRefNumber() {
        return refNumber;
    }

    public void setRefNumber(Long refNumber) {
        this.refNumber = refNumber;
    }

    public String getRequestStatus() {
        return requestStatus;
    }

    public void setRequestStatus(String requestStatus) {
        this.requestStatus = requestStatus;
    }

    public String getRequestPreStatus() {
        return requestPreStatus;
    }

    public void setRequestPreStatus(String requestPreStatus) {
        this.requestPreStatus = requestPreStatus;
    }

    public String getRequesterStaffId() {
        return requesterStaffId;
    }

    public void setRequesterStaffId(String requesterStaffId) {
        this.requesterStaffId = requesterStaffId;
    }

    public String getRequesterDomainId() {
        return requesterDomainId;
    }

    public void setRequesterDomainId(String requesterDomainId) {
        this.requesterDomainId = requesterDomainId;
    }

    public String getRequesterDisplayName() {
        return requesterDisplayName;
    }

    public void setRequesterDisplayName(String requesterDisplayName) {
        this.requesterDisplayName = requesterDisplayName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getTeamName() {
        return teamName;
    }

    public void setTeamName(String teamName) {
        this.teamName = teamName;
    }

    public String getEndorserList() {
        return endorserList;
    }

    public String getRelateCategoryName() {
        return relateCategoryName;
    }

    public void setRelateCategoryName(String relateCategoryName) {
        this.relateCategoryName = relateCategoryName;
    }

    public String getRelateSubCategoryList() {
        return relateSubCategoryList;
    }

    public void setRelateSubCategoryList(String relateSubCategoryList) {
        this.relateSubCategoryList = relateSubCategoryList;
    }

    public void setEndorserList(String endorserList) {
        this.endorserList = endorserList;
    }

    public String getCopyTo() {
        return copyTo;
    }

    public void setCopyTo(String copyTo) {
        this.copyTo = copyTo;
    }

    public Integer getNeedNotifyHkctr() {
        return needNotifyHkctr;
    }

    public void setNeedNotifyHkctr(Integer needNotifyHkctr) {
        this.needNotifyHkctr = needNotifyHkctr;
    }

    public String getTtNumber() {
        return ttNumber;
    }

    public void setTtNumber(String ttNumber) {
        this.ttNumber = ttNumber;
    }

    public String getTtLevel() {
        return ttLevel;
    }

    public void setTtLevel(String ttLevel) {
        this.ttLevel = ttLevel;
    }

    public String getChangeType() {
        return changeType;
    }

    public void setChangeType(String changeType) {
        this.changeType = changeType;
    }

    public String getChangeClassification() {
        return changeClassification;
    }

    public void setChangeClassification(String changeClassification) {
        this.changeClassification = changeClassification;
    }

    public String getUrgency() {
        return urgency;
    }

    public void setUrgency(String urgency) {
        this.urgency = urgency;
    }

    public String getChangeObjective() {
        return changeObjective;
    }

    public void setChangeObjective(String changeObjective) {
        this.changeObjective = changeObjective;
    }

    public String getRelatedPcrs() {
        return relatedPcrs;
    }

    public void setRelatedPcrs(String relatedPcrs) {
        this.relatedPcrs = relatedPcrs;
    }

    public String getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(String categoryId) {
        this.categoryId = categoryId;
    }

    public String getSubcategoryId() {
        return subcategoryId;
    }

    public void setSubcategoryId(String subcategoryId) {
        this.subcategoryId = subcategoryId;
    }

    public String getInvolvedPlatform() {
        return involvedPlatform;
    }

    public void setInvolvedPlatform(String involvedPlatform) {
        this.involvedPlatform = involvedPlatform;
    }

    public Date getExpectedDate() {
        return expectedDate;
    }

    public void setExpectedDate(Date expectedDate) {
        this.expectedDate = expectedDate;
    }

    public String getExpectedTime() {
        return expectedTime;
    }

    public void setExpectedTime(String expectedTime) {
        this.expectedTime = expectedTime;
    }

    public String getEmergencyId() {
        return emergencyId;
    }

    public void setEmergencyId(String emergencyId) {
        this.emergencyId = emergencyId;
    }

    public String getSecadminRef() {
        return secadminRef;
    }

    public void setDisasterRecovery(String disasterRecovery) {
        this.disasterRecovery = disasterRecovery;
    }

    public String getDisasterRecovery() {
        return disasterRecovery;
    }

    public void setSecadminRef(String secadminRef) {
        this.secadminRef = secadminRef;
    }

    public String getOnlineServiceImpact() {
        return onlineServiceImpact;
    }

    public void setOnlineServiceImpact(String onlineServiceImpact) {
        if (onlineServiceImpact != null) {
            this.onlineServiceImpact = onlineServiceImpact.trim();
        } else {
            this.onlineServiceImpact = null;
        }
    }

    public Date getOnlineServiceImpactFromDate() {
        return onlineServiceImpactFromDate;
    }

    public void setOnlineServiceImpactFromDate(Date onlineServiceImpactFromDate) {
        this.onlineServiceImpactFromDate = onlineServiceImpactFromDate;
    }

    public Date getOnlineServiceImpactToDate() {
        return onlineServiceImpactToDate;
    }

    public void setOnlineServiceImpactToDate(Date onlineServiceImpactToDate) {
        this.onlineServiceImpactToDate = onlineServiceImpactToDate;
    }

    public String getApproveOnlineServiceImpact() {
        return approveOnlineServiceImpact;
    }

    public void setApproveOnlineServiceImpact(String approveOnlineServiceImpact) {
        this.approveOnlineServiceImpact = approveOnlineServiceImpact;
    }

    public String getApprovalIsNeeded() {
        return approvalIsNeeded;
    }

    public void setApprovalIsNeeded(String approvalIsNeeded) {
        this.approvalIsNeeded = approvalIsNeeded;
    }

    public String getApprovalCategoryIsNeeded() {
        return approvalCategoryIsNeeded;
    }

    public void setApprovalCategoryIsNeeded(String approvalCategoryIsNeeded) {
        this.approvalCategoryIsNeeded = approvalCategoryIsNeeded;
    }

    public String getApproveQATestResult() {
        return approveQATestResult;
    }

    public void setApproveQATestResult(String approveQATestResult) {
        this.approveQATestResult = approveQATestResult;
    }

    public String getApprovePPRunResult() {
        return approvePPRunResult;
    }

    public void setApprovePPRunResult(String approvePPRunResult) {
        this.approvePPRunResult = approvePPRunResult;
    }

    public Integer getNeedPostAnnounce() {
        return needPostAnnounce;
    }

    public void setNeedPostAnnounce(Integer needPostAnnounce) {
        this.needPostAnnounce = needPostAnnounce;
    }

    public String getApplicationImpact() {
        return applicationImpact;
    }

    public void setApplicationImpact(String applicationImpact) {
        this.applicationImpact = applicationImpact;
    }

    public String getSystemImpact() {
        return systemImpact;
    }

    public void setSystemImpact(String systemImpact) {
        this.systemImpact = systemImpact;
    }

    public String getDrRating() {
        return drRating;
    }

    public void setDrRating(String drRating) {
        this.drRating = drRating;
    }

    public String getDrInfo() {
        return drInfo;
    }

    public void setDrInfo(String drInfo) {
        this.drInfo = drInfo;
    }

    public String getWorkingDuriation() {
        return workingDuriation;
    }

    public void setWorkingDuriation(String workingDuriation) {
        this.workingDuriation = workingDuriation;
    }

    public String getVerificationDuriation() {
        return verificationDuriation;
    }

    public void setVerificationDuriation(String verificationDuriation) {
        this.verificationDuriation = verificationDuriation;
    }

    public String getSecondVerifier() {
        return secondVerifier;
    }

    public void setSecondVerifier(String secondVerifier) {
        this.secondVerifier = secondVerifier.toUpperCase().replaceAll(",", ";").replaceAll("\n", "").replaceAll("\r", "").trim();
    }

    public String getCoordinator() {
        return coordinator;
    }

    public void setCoordinator(String coordinator) {
        if (coordinator != null) {
            this.coordinator = coordinator;
        }
    }

    public String getContactNo() {
        return contactNo;
    }

    public void setContactNo(String contactNo) {
        this.contactNo = contactNo;
    }

    public Date getVerificationDeadling() {
        return verificationDeadling;
    }

    public void setVerificationDeadling(Date verificationDeadling) {
        this.verificationDeadling = verificationDeadling;
    }

    public String getRecoveryDuriation() {
        return recoveryDuriation;
    }

    public void setRecoveryDuriation(String recoveryDuriation) {
        this.recoveryDuriation = recoveryDuriation;
    }

    public String getTestEnv() {
        return testEnv;
    }

    public void setTestEnv(String testEnv) {
        this.testEnv = testEnv;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public String getChgCtlRef() {
        return chgCtlRef;
    }

    public void setChgCtlRef(String chgCtlRef) {
        this.chgCtlRef = chgCtlRef;
    }

    public String getVerificationResult() {
        return verificationResult;
    }

    public void setVerificationResult(String verificationResult) {
        this.verificationResult = verificationResult;
    }

    public String getFirstVerificationResult() {
        return firstVerificationResult;
    }

    public void setFirstVerificationResult(String firstVerificationResult) {
        this.firstVerificationResult = firstVerificationResult;
    }

    public String getVerificationReason() {
        return verificationReason;
    }

    public void setVerificationReason(String verificationReason) {
        this.verificationReason = verificationReason;
    }

    public String getVerificationImpact() {
        return verificationImpact;
    }

    public void setVerificationImpact(String verificationImpact) {
        this.verificationImpact = verificationImpact;
    }

    public String getFirstVerificationReason() {
        return firstVerificationReason;
    }

    public void setFirstVerificationReason(String firstVerificationReason) {
        this.firstVerificationReason = firstVerificationReason;
    }

    public String getFirstVerificationImpact() {
        return firstVerificationImpact;
    }

    public void setFirstVerificationImpact(String firstVerificationImpact) {
        this.firstVerificationImpact = firstVerificationImpact;
    }

    public Date getEndorsedAt() {
        return endorsedAt;
    }

    public void setEndorsedAt(Date endorsedAt) {
        this.endorsedAt = endorsedAt;
    }

    public String getEndorsedBy() {
        return endorsedBy;
    }

    public void setEndorsedBy(String endorsedBy) {
        this.endorsedBy = endorsedBy;
    }

    public Date getCirculatedAt() {
        return circulatedAt;
    }

    public void setCirculatedAt(Date circulatedAt) {
        this.circulatedAt = circulatedAt;
    }

    public String getApproveImpactBy() {
        return approveImpactBy;
    }

    public void setApproveImpactBy(String approveImpactBy) {
        this.approveImpactBy = approveImpactBy;
    }

    public void setInchargeBy(String inchargeBy) {
        this.inchargeBy = inchargeBy;
    }

    public String getInchargeBy() {
        return inchargeBy;
    }

    public void setProgress(String progress) {
        this.progress = progress;
    }

    public String getProgress() {
        return progress;
    }

    public void setDrSetupStatus(String drSetupStatus) {
        this.drSetupStatus = drSetupStatus;
    }

    public String getDrSetupStatus() {
        return drSetupStatus;
    }

    public void setDrSetupDate(Date drSetupDate) {
        this.drSetupDate = drSetupDate;
    }

    public Date getDrSetupDate() {
        return drSetupDate;
    }

    public void setRequireFallBack(String requireFallBack) {
        this.requireFallBack = requireFallBack;
    }

    public String getRequireFallBack() {
        return requireFallBack;
    }

    public String getFirstVerifyFallBack() {
        return firstVerifyFallBack;
    }

    public void setFirstVerifyFallBack(String firstVerifyFallBack) {
        this.firstVerifyFallBack = firstVerifyFallBack;
    }

    public String getSecondVerifyFallBack() {
        return secondVerifyFallBack;
    }

    public void setSecondVerifyFallBack(String secondVerifyFallBack) {
        this.secondVerifyFallBack = secondVerifyFallBack;
    }

    public void setTestingResult(String testingResult) {
        this.testingResult = testingResult;
    }

    public String getTestingResult() {
        return testingResult;
    }

    public void setPpTrialRunResult(String ppTrialRunResult) {
        this.ppTrialRunResult = ppTrialRunResult;
    }

    public String getPpTrialRunResult() {
        return ppTrialRunResult;
    }

    public Date getPpConfirmationDate() {
        return ppConfirmationDate;
    }

    public void setPpConfirmationDate(Date ppConfirmationDate) {
        this.ppConfirmationDate = ppConfirmationDate;
    }

    public void setReasonOfFallbackAction(String reasonOfFallbackAction) {
        this.reasonOfFallbackAction = reasonOfFallbackAction;
    }

    public String getReasonOfFallbackAction() {
        return reasonOfFallbackAction;
    }

    public void setHasMore2ndVerifier(String hasMore2ndVerifier) {
        this.hasMore2ndVerifier = hasMore2ndVerifier;
    }

    public String getHasMore2ndVerifier() {
        return hasMore2ndVerifier;
    }

    public String getFirstVerifier() {
        return firstVerifier;
    }

    public void setFirstVerifier(String firstVerifier) {
        if (firstVerifier != null) {
            this.firstVerifier = firstVerifier.trim();
        }
    }

    public String getFirstCoordinator() {
        return firstCoordinator;
    }

    public void setFirstCoordinator(String firstCoordinator) {
        if (firstCoordinator != null) {
            this.firstCoordinator = firstCoordinator.trim();
        }
    }

    public String getFirstContactNo() {
        return firstContactNo;
    }

    public void setFirstContactNo(String firstContactNo) {
        this.firstContactNo = firstContactNo;
    }

    public String getHasMoreFirstVerifier() {
        return hasMoreFirstVerifier;
    }

    public void setHasMoreFirstVerifier(String hasMoreFirstVerifier) {
        this.hasMoreFirstVerifier = hasMoreFirstVerifier;
    }

    public String getCreateFrom() {
        return createFrom;
    }

    public void setCreateFrom(String createFrom) {
        this.createFrom = createFrom;
    }

    public String getCmsNo() {
        return cmsNo;
    }

    public void setCmsNo(String cmsNo) {
        this.cmsNo = cmsNo;
    }

    public String getService() {
        return service;
    }

    public void setService(String service) {
        this.service = service;
    }

    public String getLocations() {
        return locations;
    }

    public void setLocations(String locations) {
        this.locations = locations;
    }

    public String getZones() {
        return zones;
    }

    public void setZones(String zones) {
        this.zones = zones;
    }

    public String getRiskLevel() {
        return riskLevel;
    }

    public void setRiskLevel(String riskLevel) {
        this.riskLevel = riskLevel;
    }

    public String getRiskAssessment() {
        return riskAssessment;
    }

    public void setRiskAssessment(String riskAssessment) {
        this.riskAssessment = riskAssessment;
    }

    public String getRiskAssessmentReviewResult() {
        return riskAssessmentReviewResult;
    }

    public void setRiskAssessmentReviewResult(String riskAssessmentReviewResult) {
        this.riskAssessmentReviewResult = riskAssessmentReviewResult;
    }

    public String getRiskAssessmentRemark() {
        return riskAssessmentRemark;
    }

    public void setRiskAssessmentRemark(String riskAssessmentRemark) {
        this.riskAssessmentRemark = riskAssessmentRemark;
    }

    public String getRiskAssessmentProgress() {
        return riskAssessmentProgress;
    }

    public void setRiskAssessmentProgress(String riskAssessmentProgress) {
        this.riskAssessmentProgress = riskAssessmentProgress;
    }

    public Boolean getRiskAssessmentIsChanged() {
        return riskAssessmentIsChanged;
    }

    public void setRiskAssessmentIsChanged(Boolean riskAssessmentIsChanged) {
        this.riskAssessmentIsChanged = riskAssessmentIsChanged;
    }

    public Boolean getIsNeedRollBackStatus() {
        return isNeedRollBackStatus;
    }

    public void setIsNeedRollBackStatus(Boolean isNeedRollBackStatus) {
        this.isNeedRollBackStatus = isNeedRollBackStatus;
    }

    public String getOldRiskAssessmentReviewResult() {
        return oldRiskAssessmentReviewResult;
    }

    public void setOldRiskAssessmentReviewResult(String oldRiskAssessmentReviewResult) {
        this.oldRiskAssessmentReviewResult = oldRiskAssessmentReviewResult;
    }

    public String getOldRiskAssessmentRemark() {
        return oldRiskAssessmentRemark;
    }

    public void setOldRiskAssessmentRemark(String oldRiskAssessmentRemark) {
        this.oldRiskAssessmentRemark = oldRiskAssessmentRemark;
    }

    public String getOldRiskAssessmentProgress() {
        return oldRiskAssessmentProgress;
    }

    public void setOldRiskAssessmentProgress(String oldRiskAssessmentProgress) {
        this.oldRiskAssessmentProgress = oldRiskAssessmentProgress;
    }

    public String getNewRiskLevel() {
        return newRiskLevel;
    }

    public void setNewRiskLevel(String newRiskLevel) {
        this.newRiskLevel = newRiskLevel;
    }

    public String getOldRiskLevel() {
        return oldRiskLevel;
    }

    public void setOldRiskLevel(String oldRiskLevel) {
        this.oldRiskLevel = oldRiskLevel;
    }

    public Boolean getIsNeedChangeObjective() {
        return isNeedChangeObjective;
    }

    public void setIsNeedChangeObjective(Boolean isNeedChangeObjective) {
        this.isNeedChangeObjective = isNeedChangeObjective;
    }

    public String getOldChangeObjective() {
        return oldChangeObjective;
    }

    public void setOldChangeObjective(String oldChangeObjective) {
        this.oldChangeObjective = oldChangeObjective;
    }

    public String getOldStatus() {
        return oldStatus;
    }

    public void setOldStatus(String oldStatus) {
        this.oldStatus = oldStatus;
    }

    public List<ChangeDetail> getRecoveryChangeDetails() {
        if (recoveryChangeDetails == null) {
            recoveryChangeDetails = new ArrayList<>();
        }
        return recoveryChangeDetails;
    }

    public void setRecoveryChangeDetails(List<ChangeDetail> recoveryChangeDetails) {
        this.recoveryChangeDetails = recoveryChangeDetails;
    }

    public String getOldCategoryName() {
        return oldCategoryName;
    }

    public void setOldCategoryName(String oldCategoryName) {
        this.oldCategoryName = oldCategoryName;
    }

    public String getOldSubCategoryName() {
        return oldSubCategoryName;
    }

    public void setOldSubCategoryName(String oldSubCategoryName) {
        this.oldSubCategoryName = oldSubCategoryName;
    }

    public Boolean getImportantFieldIsChanged() {
        return importantFieldIsChanged;
    }

    public void setImportantFieldIsChanged(Boolean importantFieldIsChanged) {
        this.importantFieldIsChanged = importantFieldIsChanged;
    }

    public Boolean getWorkingProcedureChanged() {
        return workingProcedureChanged;
    }

    public void setWorkingProcedureChanged(Boolean workingProcedureChanged) {
        this.workingProcedureChanged = workingProcedureChanged;
    }

    public Boolean getWpTaskStatusIsChanged() {
        return wpTaskStatusIsChanged;
    }

    public void setWpTaskStatusIsChanged(Boolean wpTaskStatusIsChanged) {
        this.wpTaskStatusIsChanged = wpTaskStatusIsChanged;
    }

    public String getChangeWorkingStatusBy() {
        return changeWorkingStatusBy;
    }

    public void setChangeWorkingStatusBy(String changeWorkingStatusBy) {
        this.changeWorkingStatusBy = changeWorkingStatusBy;
    }

    public String getChangeImportantFieldsAndQAPPBy() {
        return changeImportantFieldsAndQAPPBy;
    }

    public void setChangeImportantFieldsAndQAPPBy(String changeImportantFieldsAndQAPPBy) {
        this.changeImportantFieldsAndQAPPBy = changeImportantFieldsAndQAPPBy;
    }

    public Boolean getServiceImpactIsApproved() {
        return serviceImpactIsApproved;
    }

    public void setServiceImpactIsApproved(Boolean serviceImpactIsApproved) {
        this.serviceImpactIsApproved = serviceImpactIsApproved;
    }

    public Boolean getFirVerificationIsChanged() {
        return firVerificationIsChanged;
    }

    public void setFirVerificationIsChanged(Boolean firVerificationIsChanged) {
        this.firVerificationIsChanged = firVerificationIsChanged;
    }

    public Boolean getSecVerificationIsChanged() {
        return secVerificationIsChanged;
    }

    public void setSecVerificationIsChanged(Boolean secVerificationIsChanged) {
        this.secVerificationIsChanged = secVerificationIsChanged;
    }

    public Boolean getQaTestingResultIsChanged() {
        return qaTestingResultIsChanged;
    }

    public void setQaTestingResultIsChanged(Boolean qATestingResultIsChanged) {
        qaTestingResultIsChanged = qATestingResultIsChanged;
    }

    public Boolean getPpRunResultIsChanged() {
        return ppRunResultIsChanged;
    }

    public void setPpRunResultIsChanged(Boolean pPRunResultIsChanged) {
        ppRunResultIsChanged = pPRunResultIsChanged;
    }

    public Boolean getStatusIsChangedByHKCTR() {
        return statusIsChangedByHKCTR;
    }

    public void setStatusIsChangedByHKCTR(Boolean statusIsChangedByHKCTR) {
        this.statusIsChangedByHKCTR = statusIsChangedByHKCTR;
    }

    public Boolean getChgcntlIsChanged() {
        return chgcntlIsChanged;
    }

    public void setChgcntlIsChanged(Boolean chgcntlIsChanged) {
        this.chgcntlIsChanged = chgcntlIsChanged;
    }

    public String getChangeChgcntlBy() {
        return changeChgcntlBy;
    }

    public void setChangeChgcntlBy(String changeChgcntlBy) {
        this.changeChgcntlBy = changeChgcntlBy;
    }

    public Boolean getIsApprover() {
        return isApprover;
    }

    public void setIsApprover(Boolean isApprover) {
        this.isApprover = isApprover;
    }

    public Boolean getIsPCRSDone() {
        return isPCRSDone;
    }

    public void setIsPCRSDone(Boolean isPCRSDone) {
        this.isPCRSDone = isPCRSDone;
    }

    public Boolean getIsAcceptPP() {
        return isAcceptPP;
    }

    public void setIsAcceptPP(Boolean isAcceptPP) {
        this.isAcceptPP = isAcceptPP;
    }

    public Boolean getIsAcceptQA() {
        return isAcceptQA;
    }

    public void setIsAcceptQA(Boolean isAcceptQA) {
        this.isAcceptQA = isAcceptQA;
    }

    public String getAcceptBy() {
        return acceptBy;
    }

    public void setAcceptBy(String acceptBy) {
        this.acceptBy = acceptBy;
    }

    public String getChangeStatusBy() {
        return changeStatusBy;
    }

    public void setChangeStatusBy(String changeStatusBy) {
        this.changeStatusBy = changeStatusBy;
    }

    public List<ChangeDetail> getProcedureChangeDetails() {
        if (procedureChangeDetails == null) {
            procedureChangeDetails = new ArrayList<>();
        }
        return procedureChangeDetails;
    }

    public void setProcedureChangeDetails(List<ChangeDetail> procedureChangeDetails) {
        this.procedureChangeDetails = procedureChangeDetails;
    }

    public String getHasOnlineServiceImpact() {
        return hasOnlineServiceImpact;
    }

    public void setHasOnlineServiceImpact(String hasOnlineServiceImpact) {
        this.hasOnlineServiceImpact = hasOnlineServiceImpact;
    }

    public String getOldHasOnlineServiceImpact() {
        return oldHasOnlineServiceImpact;
    }

    public void setOldHasOnlineServiceImpact(String oldHasOnlineServiceImpact) {
        this.oldHasOnlineServiceImpact = oldHasOnlineServiceImpact;
    }

    public String getHasApplicationImpact() {
        return hasApplicationImpact;
    }

    public void setHasApplicationImpact(String hasApplicationImpact) {
        this.hasApplicationImpact = hasApplicationImpact;
    }

    public String getOldHasApplicationImpact() {
        return oldHasApplicationImpact;
    }

    public void setOldHasApplicationImpact(String oldHasApplicationImpact) {
        this.oldHasApplicationImpact = oldHasApplicationImpact;
    }

    public String getOldOnlineServiceImpact() {
        return oldOnlineServiceImpact;
    }

    public void setOldOnlineServiceImpact(String oldOnlineServiceImpact) {
        this.oldOnlineServiceImpact = oldOnlineServiceImpact;
    }

    public Date getOldOnlineServiceImpactFromDate() {
        return oldOnlineServiceImpactFromDate;
    }

    public void setOldOnlineServiceImpactFromDate(Date oldOnlineServiceImpactFromDate) {
        this.oldOnlineServiceImpactFromDate = oldOnlineServiceImpactFromDate;
    }

    public Date getOldOnlineServiceImpactToDate() {
        return oldOnlineServiceImpactToDate;
    }

    public void setOldOnlineServiceImpactToDate(Date oldOnlineServiceImpactToDate) {
        this.oldOnlineServiceImpactToDate = oldOnlineServiceImpactToDate;
    }

    public String getOldApplicationServiceImpact() {
        return oldApplicationServiceImpact;
    }

    public void setOldApplicationServiceImpact(String oldApplicationServiceImpact) {
        this.oldApplicationServiceImpact = oldApplicationServiceImpact;
    }

    public List<String> getFirstVerificationResultList() {
        if (firstVerificationResultList == null) {
            return new ArrayList<>();
        }
        return firstVerificationResultList;
    }

    public void setFirstVerificationResultList(List<String> firstVerificationResultList) {
        this.firstVerificationResultList = firstVerificationResultList;
    }

    public List<RequestProcedures> getRequestprocedures() {
        return requestprocedures;
    }

    public void setRequestprocedures(List<RequestProcedures> requestprocedures) {
        this.requestprocedures = requestprocedures;
    }

    public List<RequestAttachment> getRequestattachments() {
        return requestattachments;
    }

    public void setRequestattachments(List<RequestAttachment> requestattachments) {
        this.requestattachments = requestattachments;
    }

    public List<RequestPostmortem> getRequestpostmortem() {
        return requestpostmortem;
    }

    public void setRequestpostmortem(List<RequestPostmortem> requestpostmortem) {
        this.requestpostmortem = requestpostmortem;
    }

    public boolean asReqeuster(String domainID) {
        return domainID.equalsIgnoreCase(this.requesterDomainId);
    }

    public boolean canEndorse(String domainID) {
        if (this.endorserList != null && !this.endorserList.isEmpty())
            for (String s : this.endorserList.split(";"))
                if (domainID.equalsIgnoreCase(s))
                    return true;

        return false;
    }

    public boolean asSecondVerifer(String domainID) {
        for (String s : this.secondVerifier.split(";"))
            if (s.equalsIgnoreCase(domainID))
                return true;

        return false;
    }

    public boolean asFirstVerifer(String domainID) {
        for (String s : this.firstVerifier.split(";"))
            if (s.equalsIgnoreCase(domainID))
                return true;

        return false;
    }

    public boolean asExecutor(String domainID) {
        List<RequestProcedures> requestProcedures = this.getWorkingProcedures();
        for (RequestProcedures requestProcedure : requestProcedures) {
            if (requestProcedure.getHandledBy() != null && !requestProcedure.getHandledBy().isEmpty()) {
                for (String s : requestProcedure.getHandledBy().split(";"))
                    if (s.equalsIgnoreCase(domainID))
                        return true;
            }
        }
        return false;
    }

    @Transient
    public List<RequestProcedures> getWorkingProcedures() {

        isStartProcessTask = false;
        List<RequestProcedures> listObjects = getRequestProceduresByType(ProceduresType.TYPE_WORKING);
        listObjects.stream().forEach(item -> {
            if (item.getTaskStatus() != null && item.getTaskStatus() != "") {
                isStartProcessTask = true;
            }
        });
        return listObjects;
    }

    public Boolean getIsStartProcessTask() {
        return isStartProcessTask;
    }

    public void setIsStartProcessTask(Boolean isStartProcessTask) {
        this.isStartProcessTask = isStartProcessTask;
    }

    @Transient
    public List<RequestProcedures> getVerifyProcedures() {
        return getRequestProceduresByType(ProceduresType.TYPE_VERIFY);
    }

    @Transient
    private List<RequestProcedures> getRequestProceduresByType(String type) {
        return this.getRequestprocedures().stream()
                .filter(procedure -> procedure.getProcedureType().equals(type) && procedure.getProcedureSeq() >= 0)
                .sorted(Comparator.comparingInt(RequestProcedures::getProcedureSeq))
                .collect(Collectors.toList());
    }

    @Transient
    public List<RequestProcedures> getRecoveryProcedures() {
        return getRequestProceduresByType(ProceduresType.TYPE_RECOVERY);
    }

    //changed by fiona
    public String hasOnlineServiceImpact() {
        String hasOnlineServicesImpact = "No";
        if (getOnlineServiceImpact() != null && !getOnlineServiceImpact().isEmpty()) {
            hasOnlineServicesImpact = "Yes";
        }
        return hasOnlineServicesImpact;
    }

    public String getOldExpectedDate() {
        return oldExpectedDate;
    }

    public void setOldExpectedDate(String oldExpectedDate) {
        this.oldExpectedDate = oldExpectedDate;
    }

    public String getOldExpectedTime() {
        return oldExpectedTime;
    }

    public void setOldExpectedTime(String oldExpectedTime) {
        this.oldExpectedTime = oldExpectedTime;
    }

    public String getOldPPRunResult() {
        return oldPPRunResult;
    }

    public void setOldPPRunResult(String oldPPRunResult) {
        this.oldPPRunResult = oldPPRunResult;
    }

    public String getOldQATestingResult() {
        return oldQATestingResult;
    }

    public void setOldQATestingResult(String oldQATestingResult) {
        this.oldQATestingResult = oldQATestingResult;
    }

    public Boolean getIsPPNeedToPending() {
        return isPPNeedToPending;
    }

    public void setIsPPNeedToPending(Boolean isPPNeedToPending) {
        this.isPPNeedToPending = isPPNeedToPending;
    }

    public Boolean getIsQANeedToPending() {
        return isQANeedToPending;
    }

    public void setIsQANeedToPending(Boolean isQANeedToPending) {
        this.isQANeedToPending = isQANeedToPending;
    }

    public String getRequestType() {
        return requestType;
    }

    public void setRequestType(String requestType) {
        this.requestType = requestType;
    }

}
